const express=require("express")
const path=require("path")
const app = express()


const addAdminRoute = require("./routes/addAdmin");
const findAdminRoute = require("./routes/findAdmin");
const deleteAdminRoute = require("./routes/deleteAdmin");
const loginRoute = require("./routes/login");
const isLoginRoute = require("./routes/isLogin");
const loginOutRoute = require("./routes/outLogin");
const addAdvRoute = require("./routes/addAdv");
const findAdvRoute = require("./routes/findAdv");
const deleteAdvRoute = require("./routes/deleteAdv");
const updateAdvRoute = require("./routes/updateAdv");

require('./db')
app.use(express.urlencoded())
app.use(express.json())


app.use(addAdminRoute)
app.use(findAdminRoute)
app.use(deleteAdminRoute)
app.use(loginRoute)
app.use(isLoginRoute)
app.use(loginOutRoute);
app.use(addAdvRoute);
app.use(findAdvRoute)
app.use(deleteAdvRoute)
app.use(updateAdvRoute)


app.use("/upload",express.static(path.resolve(__dirname,"./upload")))


app.listen(8000, () => {
    console.log("success","http://127.0.0.1:8000");
})